<?php
namespace app\admin\controller;
use think\Db;
class Index extends Common
{

	//首页页面
    public function index()
    {   
    	return $this->fetch();
    }

    //首页主题内容
    public function main()
    {   
    	//系统信息
    	$version = Db::query('SELECT VERSION() AS ver');
       
    	$config = [
            'url'             => $_SERVER['HTTP_HOST'],
            'document_root'   => $_SERVER['DOCUMENT_ROOT'],
            'server_os'       => PHP_OS,
            'server_port'     => $_SERVER['SERVER_PORT'],
            'server_ip'       => $_SERVER['SERVER_ADDR'],
            'server_soft'     => $_SERVER['SERVER_SOFTWARE'],
            'php_version'     => PHP_VERSION,
            'mysql_version'   => $version[0]['ver'],
		];

		$this->assign('config',$config);
		
    	return $this->fetch();
    }
    
    //清除缓存
    public function clear(){
        $dir = '../runtime';   
        rmdirs($dir);
        $this->success('清除成功','admin/index/index',0,1);
    }
}